﻿@model Wicresoft.UnifyShow.Business.EventTypeModel
@{
    ViewBag.Title = "添加自服务事件分类";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
    string error = (string)ViewBag.error;
    bool post = ViewBag.Post ?? false;
}
<div class="index_lr">
    @if (post && string.IsNullOrWhiteSpace(error))
    {
        <script type="text/javascript">

            $(document).ready(function () {
                alert("添加成功。")
            });
        </script> 
    }
    
    <ul>
        <li class="index_lr2_M">
            <div class="index_lrA_title ui-icons">
                <h3>添加自服务事件</h3>
            </div>
            @using (Html.BeginForm())
            {
                <div class="index_pt_bg">
                    <table>
                        <tbody>
                            <tr>
                                <td>
                                    <label>事件名称：</label>
                                </td>
                                <td>
                                    @Html.EditorFor(model => model.TIER3)
                                </td>
                                <td>
                                    <label>事件属性：</label>
                                </td>
                                <td>
                                     @*@Html.DropDownList("Categroy", (IEnumerable<SelectListItem>)ViewData["Categories"])*@
                                    @Html.EditorFor(model => model.EVENT_PROPERTIES)
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <label>事件分类1：</label>
                                </td>
                                <td>
                                    @Html.EditorFor(model => model.TIER1)
                                </td>
                                <td>
                                    <label>事件分类2：</label>
                                </td>
                                <td>
                                    @Html.EditorFor(model => model.TIER2)
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <span style="color: Red" id="errorInfo"></span>
                                    @if (!string.IsNullOrWhiteSpace(error)){ 
                                        <script type="text/javascript">
                                            $("#errorInfo").val() = "";
                                        </script>
                                        <span style="color: Red" id="errorInfo1">@error</span>
                                    }
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <p>
                        <input type="submit" value="添加" id="addSubmit" />
                    </p>
                </div>
            }
        </li>
    </ul>
</div>
@section ScriptAndCss{
    @*    <script src="../../Scripts/jquery-1.4.4-vsdoc.js" type="text/javascript"></script>*@
    <script type="text/javascript">
        $(function () {
            $("form").submit(function () {
                var error = ""
                var isContain = 0;
                if ($("#ServiceName").val() == "") error += "事件名称不能为空。";

                if (error != "") {
                    $("#errorInfo").html(error);
                    return false;
                }
                return true;
            });
        });
    
    
    </script>
}
